package com.travel.system.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.View;

import javax.persistence.*;

@Entity
@Table(name = "users")
@Erupt(name = "用户管理")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "users")
@Schema(description = "用户表")
public class UserInfo {
    /**
     * 用户ID
     */
    //主键
    @Id
    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "native")
    @Column(name = "id")
    @EruptField
    private Long id;
    /**
     * 用户名
     */
    @EruptField(
            views = @View(title = "用户名"),
            edit = @Edit(title = "用户名")
    )
    private String username;
    /**
     * 密码
     */
    @EruptField(
            views = @View(title = "密码"),
            edit = @Edit(title = "密码")
    )
    private String password;
    /**
     * 电子邮件
     */
    @EruptField(
            views = @View(title = "电子邮件"),
            edit = @Edit(title = "电子邮件")
    )
    private String email;

}
